import Vue from 'vue';
import { Toast } from 'vant';
Vue.use(Toast);

export function loading(needLoaing,msgForLoaing) {
  needLoaing && Toast.loading({
    message:msgForLoaing,
    duration:0
  })
}

export function success(needLoaing,msgForSuccess) {
  needLoaing && Toast.clear();
  needLoaing && Toast.success({
    message:msgForSuccess,
    duration:500
  })
}

export function fail(needLoaing,msgForFail) {
  needLoaing && Toast.clear();
  needLoaing && Toast.fail({
    message:msgForFail,
    duration:500
  })
}
